<!DOCTYPE html>
<html style="height: 100%">
   <head>
       <meta charset="utf-8">
   </head>
   <body style="height: 100%; margin: 0">
       <div id="container" style="height: 100%"></div>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-gl/dist/echarts-gl.min.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-stat/dist/ecStat.min.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/extension/dataTool.min.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/map/js/china.js"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/map/js/world.js"></script>
       <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=xfhhaTThl11qYVrqLZii6w8qE5ggnhrY&__ec_v__=20190126"></script>
       <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/extension/bmap.min.js"></script>
       <script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;
option = {
    title : {
        text: '月度家庭消费支出明细',
        subtext: '纯属虚构',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        left: 'left',
        data: ['伙食消费','交通费用','人情往来','房屋租金','水电气','淘宝网购']
    },
    series : [
        {
            name: '支出类型',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[
                {value:0, name:'伙食消费'},
                {value:0, name:'交通费用'},
                {value:0, name:'人情往来'},
                {value:0, name:'房屋租金'},
                {value:0, name:'水电气'},
                {value:0, name:'淘宝网购'}
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};
;

function showPiChart(var0, var1, var2, var3, var4, var5){
    myChart.showLoading();
    if (option && typeof option === "object") {
        option["series"][0]["data"][0]["value"] = var0;
        option["series"][0]["data"][1]["value"] = var1;
        option["series"][0]["data"][2]["value"] = var2;
        option["series"][0]["data"][3]["value"] = var3;
        option["series"][0]["data"][4]["value"] = var4;
        option["series"][0]["data"][5]["value"] = var5;
        myChart.setOption(option, true);
        myChart.hideLoading();
        return null
    }
}

showPiChart(1500,300,500,2000,500,300)
       </script>
   </body>
</html>